<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateUserorderTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateUserorderLabel_id}" for="id" />
                    <h:inputText id="id" value="#{userorderController.selected.id}" title="#{bundle.CreateUserorderTitle_id}" required="true" requiredMessage="#{bundle.CreateUserorderRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.CreateUserorderLabel_date}" for="date" />
                    <h:inputText id="date" value="#{userorderController.selected.date}" title="#{bundle.CreateUserorderTitle_date}" required="true" requiredMessage="#{bundle.CreateUserorderRequiredMessage_date}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateUserorderLabel_comment}" for="comment" />
                    <h:inputTextarea rows="4" cols="30" id="comment" value="#{userorderController.selected.comment}" title="#{bundle.CreateUserorderTitle_comment}" required="true" requiredMessage="#{bundle.CreateUserorderRequiredMessage_comment}"/>
                    <h:outputLabel value="#{bundle.CreateUserorderLabel_status}" for="status" />
                    <h:inputText id="status" value="#{userorderController.selected.status}" title="#{bundle.CreateUserorderTitle_status}" required="true" requiredMessage="#{bundle.CreateUserorderRequiredMessage_status}"/>
                    <h:outputLabel value="#{bundle.CreateUserorderLabel_totalPrice}" for="totalPrice" />
                    <h:inputText id="totalPrice" value="#{userorderController.selected.totalPrice}" title="#{bundle.CreateUserorderTitle_totalPrice}" required="true" requiredMessage="#{bundle.CreateUserorderRequiredMessage_totalPrice}"/>
                    <h:outputLabel value="#{bundle.CreateUserorderLabel_addressId}" for="addressId" />
                    <h:selectOneMenu id="addressId" value="#{userorderController.selected.addressId}" title="#{bundle.CreateUserorderTitle_addressId}" required="true" requiredMessage="#{bundle.CreateUserorderRequiredMessage_addressId}">
                        <f:selectItems value="#{addressController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{userorderController.create}" value="#{bundle.CreateUserorderSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{userorderController.prepareList}" value="#{bundle.CreateUserorderShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateUserorderIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
